import service from '@/utils/request'

export const getGoodsList = (params) => { 
    return new Promise((resolve,reject)=>{
      service.post('/goods/getGoodsList',params)
      .then(res=>{
        resolve(res) 
      })
    })
}

export const saveGoods = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/goods/saveGoods',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const deleteGoods = (params) => { 
    return new Promise((resolve,reject)=>{
      service.post('/goods/deleteGoods',params)
      .then(res=>{
        resolve(res) 
      })
    })
}

export const saveGoodsSaleState = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/goods/saveGoodsSaleState',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const addGoodsStock = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/goods/addGoodsStock',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const getGoodsOrderList = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/goods/getGoodsOrderList',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const confirmGoodsOrder = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/goods/confirmGoodsOrder',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const getPayOrderList = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/pay/getPayOrderList',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const checkPayOrder = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/pay/checkPayOrder',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const getStatistics = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/report/getSalesStatisticsList',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

export const checkGoodsOrderPay = (params) => { 
  return new Promise((resolve,reject)=>{
    service.post('/goods/checkGoodsOrderPay',params)
    .then(res=>{
      resolve(res) 
    })
  })
}

